<?php Temp::Tinclude("commom/admin_header");?>
<div class="padding_left_right">
    <div class="panel panel-default margin_top20">
<div class="panel-heading">
  订单列表
  <div class="pull-right">
<form class="form-inline" role="form" action="/index.php?<?php echo $jp_arg['c'];?>/<?php echo $jp_arg['a'];?>"  method="post">
 <input type="hidden" name="<?php echo $jp_arg['c'];?>/<?php echo $jp_arg['a'];?>"/>
 <div class="form-group">
    <label for="base_name" class="sr-only">订单号</label>
    <input type="text" class="form-control" value="<?php if(isset($jp_arg['order_no']))echo $jp_arg['order_no'];?>" name="order_no" id="base_name" placeholder="订单号">
  </div>
  <div class="form-group">
    <label for="base_name" class="sr-only">收货人</label>
    <input type="text" class="form-control" value="<?php if(isset($jp_arg['user_name']))echo $jp_arg['user_name'];?>" name="user_name" id="user_name" placeholder="收货人">
  </div>
 <button type="submit" name="search" class="btn btn-default">搜索</button>
</form>
  </div>
  <div class="clearfix"></div>
</div>

    
    <table class="table table-hover table-condensed">
      <thead>
        <tr>
          <th class="text-center">订单号</th>
          <th class="text-center">销售重量</th>
          <th class="text-center">价格</th>
          <th class="text-center">收货人姓名</th>
          <th class="text-center">下单时间</th>
           <th class="text-center">订单状态</th>
          <th class="text-center">操作</th>
        </tr>
      </thead>
      <tbody>
           <?php if(isset($list)&&$list){?>
          <?php foreach($list as $val){?>
          <tr>
              <td class="text-center"><?php echo $val["order_no"];?></td>
              <td class="text-center"><?php echo $val["sale_weight"];?>斤</td>
              <td class="text-center"><?php echo $val["sale_price"];?>元</td>
              <td class="text-center"><?php echo $val["user_name"];?></td>
              <td class="text-center"><?php echo date("Y-m-d",$val["create_time"]);?></td>
               <td class="text-center"><?php if($val["status"]==1)echo "正常";else echo "作废";?></td>
              <td class="text-center">
                  <a class="btn btn-success" href="?order/edit&id=<?php echo $val["id"];?>" ><span class="glyphicon glyphicon-eye-open"></span>查看订单详情</a>
                  <button type="button" class="btn btn-primary zuofei" data-orderid="<?php echo $val["id"];?>">（订单操作）作废</button>
              </td>
          </tr>
          <?php }?>
          <?php }?>
      </tbody>
    </table>
    
        </div>
    
</div>
<script>
    $(".zuofei").click(function(){
        var orderid=$(this).data("orderid");
        if(window.confirm("确定要作废改订单吗?")){
        $.post("/?order/public_ajax_zuofei",{"oid":orderid},function(data){
            if(data.status==1){
                alert("订单已作废!");
                window.location.reload();
            }
        },"json");
    }
    });
</script>
<?php Temp::Tinclude("commom/admin_footer");?>